package com.scfire.content

import java.util.Date;

import org.grails.databinding.BindingFormat
/**
 * @author XSunny
 *
 */
class Diary implements Comparable{

	String title;
	String content;

	List<String> imgs = new LinkedList<String>();
	
	//创建时间
	@BindingFormat('yyyy-MM-dd HH:mm:ss')
	Date date
		
    static constraints = {
		title nullable:true;
		content nullable:true;
		imgs nullable:true;
		date nullable:true;
    }
	
	@Override
	public int compareTo(Object o) {
		try{
			-date.compareTo(o?.date)
		}catch(Exception e){
			return 1
		}
	}
}
